<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        html,
        body {
            width: 100%;
            height: 100%;
        }

        .container {
            width: 100%;
            height: 100%;
        }
        .light {
            background-color: white;
            color: black;
        }
        .dark {
            background-color: black;
            color: white;
        }
    </style>
</head>
<body>
    <div calss="container light">
        Hello World<br>
        Hello World<br>
        Hello World<br>
    </div>
</body>
<script>
    var div=document.querySelector('div');
    div.onclick=function () {
        if(div.className.indexOf('light')!=-1){
            div.className='container dark';
        }else{
            div.className='container light';
        }
    }
</script>
</html>